package com.bite.lesson1;

public class Demo_01 {
    public static void main(String[] args) {
        MyThread01 myThread01 = new MyThread01();
        MyThread02 myThread02 = new MyThread02();

        Thread thread01 = new Thread(myThread01);
        Thread thread02 = new Thread(myThread01);

        Thread thread03 = new Thread(myThread02);

        thread01.start();
        thread02.start();
        thread03.start();
    }
}

//制作皮鞋
class MyThread01 implements Runnable {
    @Override
    public void run() {
        while(true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("制作一双皮鞋，金币 +5......");
        }
    }
}

//制作皮包
class MyThread02 implements Runnable {
    @Override
    public void run() {
        while(true) {
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("制作一个皮包，金币 +10......");
        }
    }
}
